package cn.kais.drawer.menu;

import java.util.Objects;

/**
 * 时间枚举
 */
public enum MenuTimePattern {

    NONE("0", "None"), // 不显示时分秒
    hh_mm_ss("1", "hh:mm:ss"), // 12小时制
    HH_mm_ss("2", "HH:mm:ss"), // 24小时制
    ;

    public final String code;
    public final String format;


    MenuTimePattern(String code, String format) {
        this.code = code;
        this.format = format;
    }

    public static MenuTimePattern onParseCode(String code) {
        for (MenuTimePattern menu : MenuTimePattern.values()) {
            if (Objects.equals(menu.code, code)) {
                return menu;
            }
        }
        return NONE;
    }

}
